import { Tools } from 'weaver-mobile';
import { catchApiError } from '../util/index';
import { PARAMS } from '../components/public/BlogUtils';

// 我的微博-列表
export const getMyBlogList = params => {
	let options = {
		method: 'GET',
		url: '/api/blog/base/getMyBlogList',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

// 我的微博-搜索列表
export const getMyBlogListBySearch = params => {
	let options = {
		method: 'GET',
		url: '/api/blog/base/getMyBlogListBySearch',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}



// 我的微博-搜索列表
export const getShareToMeBlogList = params => {
	let options = {
		method: 'GET',
		url: '/api/blog/base/getShareToMeBlogList',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

// 我的微博--赞 列表
export const getMyblogListByType = params => {
	let options = {
		method: 'GET',
		url: '/api/blog/base/getMyblogListByType',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

// 添加微博评论
export const addBlogReply = params => {
	let options = {
		method: 'POST',
		url: '/api/blog/base/addBlogReply',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

// 删除微博评论
export const deleteBlogReplay = params => {
	let options = {
		method: 'POST',
		url: '/api/blog/base/deleteBlogReplay',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

// 赞或取消赞
export const addOrDeleteZan = params => {
	let options = {
		method: 'POST',
		url: '/api/blog/base/addOrDeleteZan',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

// 提醒提交微博
export const sendRemindUnsubmit = params => {
	let options = {
		method: 'GET',
		url: '/api/blog/base/sendRemindUnsubmit',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

// 获取默认模板
export const getDefaultTemplate = params => {
	let options = {
		method: 'GET',
		url: '/api/blog/base/getDefaultTemplate',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}


export const attentionUserList = params => {
	let options = {
		method: 'GET',
		url: '/api/blog/discuss/AttentionUserList',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

export const discussShareInfo = params => {
	let options = {
		method: 'GET',
		url: '/api/blog/discuss/getshareinfo',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}


export const checkUserList = params => {
	let options = {
		method: 'GET',
		url: '/api/blog/discuss/checkedUserList',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

